package promethues;

import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusProperties;

import java.time.Duration;

/**
 * @author dzh
 * @date 2023/2/1 8:47
 */
public class DemoClient {

    static PrometheusProperties.Pushgateway pushgateway = new PrometheusProperties.Pushgateway();
    static {
        pushgateway.setBaseUrl("http://localhost:9090/");
        pushgateway.setJob("spring-gateway");
        pushgateway.setEnabled(true);

    }

    @Test
    public void push() {
        Duration duration = Duration.ofMillis(110);
        pushgateway.setPushRate(duration);
    }
}
